home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD015b.dsk
/
HEX-DEC CONVERTER.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
818b
|
13 lines
5 REM HEX/DEC CONVERTER
10 HOME : PRINT "USE H FOR HEX, D FOR DECIMAL": PRINT
15 ONERR GOTO 10
16 VTAB 22: HTAB 12: INVERSE : PRINT " TYPE Q TO QUIT ": NORMAL
17 POKE 34,2: POKE 35,20: HOME
20 V = PEEK(37) +1: VTAB (1): HTAB (30): PRINT "(H/D) ? ";: GET Z$: PRINT : VTAB (V): IF Z$ = "D" THEN 60
25 IF Z$ = "Q" THEN TEXT : HOME : END
30 PRINT "H=";: INPUT "$";N$: VTAB PEEK(37): HTAB LEN(N$) +5: PRINT "";:N = 0: FOR I = 1 TO LEN(N$):A = ASC( MID$ (N$,I,1)) -48: IF A >9 THEN A = A -7
40 IF A <0 OR A >15 THEN CALL -211: PRINT : GOTO 20
50 N = 16 *N +A: NEXT : PRINT "D=";N: GOTO 20
60 B$ = CHR$(8) + CHR$(8):H$ = "0123456789ABCDEF": PRINT "D ";: INPUT "=";N: VTAB PEEK(37): HTAB 38
70 N1 = INT(N/16): PRINT MID$ (H$,N -16 *N1 +1,1)B$;:N = N1: IF N >0 THEN 70
80 PRINT B$"H=$": GOTO 20